package com.kkb.shopcenter.listener;

import com.kkb.shopcenter.common.constant.ConstantKey;
import com.kkb.shopcenter.common.pojo.GoodsInfo;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@RocketMQMessageListener(
        topic = ConstantKey.TOPIC_NAME,
        consumerGroup = "my-consumer-group",
        selectorExpression = "*"
)
@Component
public class GoodsMQListener implements RocketMQListener<GoodsInfo> {
    @Override
    public void onMessage(GoodsInfo message) {
            System.out.println(message);
    }
}
